package com.bytedance.scenedemo.utility;


import ohos.agp.colors.RgbColor;
import ohos.agp.colors.RgbPalette;
import ohos.agp.components.element.ShapeElement;

public class ColorUtil {

    private static final String[] COLOR_ARRAY =new String[]{
            "#f36c60","#aed581","#4db6ac","#f06292",
            "#a1887f","#ba68c8","#dce775","#90a4ae",
            "#9575cd","#42bd41","#7986cb","#fff176",
            "#91a7ff","#ffb74d","#4fc3f7","#ff8a65",
            "#4dd0e1","#e0e0e0"
    };

    public static ShapeElement getMaterialColor(int index) {
        if(index<0){
            index=0;
        }
        ShapeElement seBg=new ShapeElement();
        seBg.setRgbColor(RgbColor.fromArgbInt(RgbPalette.parse(COLOR_ARRAY[index%COLOR_ARRAY.length])));
        return seBg;
    }

}
